package com.youkeyi.ddy.cloud.common.api.application.business.crm.doctor;

import com.youkeyi.ddy.cloud.common.api.application.business.crm.doctor.dto.BusinessDoctorListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.doctor.param.BusinessDoctorCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.doctor.param.BusinessDoctorDeleteCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.doctor.param.BusinessDoctorListCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.doctor.param.BusinessDoctorUpdateCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统医生
 *
 * @author  liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【BUSINESS】doctor management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-BUSINESS", fallback = BusinessDoctorCloudServiceFallback.class)
@RequestMapping("/business/doctor")
public interface BusinessDoctorCloudService {

    // 查询医生列表
    @ApiOperation(value = "Query Business Doctor List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.doctor.BusinessDoctorCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = BusinessDoctorListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Business Doctor List", dataType = "BusinessDoctorListCloudParam", dataTypeClass = BusinessDoctorListCloudParam.class),
    })
    @GetMapping
    public abstract BusinessDoctorListCloudDto list(BusinessDoctorListCloudParam param);

    // 创建医生
    @ApiOperation(value = "Create Business Doctor", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.doctor.BusinessDoctorCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create Business Doctor", dataType = "BusinessDoctorCreateCloudParam", dataTypeClass = BusinessDoctorCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody BusinessDoctorCreateCloudParam param);


    // 编辑医生
    @ApiOperation(value = "Update Business Doctor", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.doctor.BusinessDoctorCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update Business Doctor", dataType = "BusinessDoctorUpdateCloudParam", dataTypeClass = BusinessDoctorUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody BusinessDoctorUpdateCloudParam param);


    // 删除医生
    @ApiOperation(value = "Delete Business Doctor", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.doctor.BusinessDoctorCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete Business Doctor", dataType = "BusinessDoctorDeleteCloudParam", dataTypeClass = BusinessDoctorDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(BusinessDoctorDeleteCloudParam param);

}
